package ext.generic.doc.processors;

import com.ptc.netmarkets.util.beans.NmCommandBean;

import wt.doc.WTDocument;

import com.ptc.core.components.util.FeedbackMessage;
import com.ptc.core.ui.resources.FeedbackType;
import com.ptc.core.components.forms.*;

import java.util.*;

import wt.util.WTException;

import wt.session.SessionHelper;

import wt.util.WTMessage;
import wt.util.LocalizableMessage;

/**
 * 该类已经取消:文档流程中"移除随签对象"的action响应方法类
 */
public class DeleteReviewDocFormProcessor
{

    public DeleteReviewDocFormProcessor()
    {
    }
    /**
     *文档流程中"移除随签对象"的具体方法
     * @param nmcommandbean
     * @param list
     * @return
     * @throws WTException
     */
    public FormResult postProcess(NmCommandBean nmcommandbean, List list) throws WTException
    {
        Vector vector = new Vector();
        WTDocument wtdocument = (WTDocument) nmcommandbean.getPrimaryOid().getWtRef().getObject();
        FormResult formresult = new FormResult();
        formresult.setStatus(FormProcessingStatus.SUCCESS);

        java.util.Locale locale = SessionHelper.getLocale();
        if (nmcommandbean.getSelected().size() == 0)
        {
            FeedbackMessage feedbackmessage =
                new FeedbackMessage(FeedbackType.FAILURE, locale, new WTMessage("com.ptc.netmarkets.util.utilResource", "NO_OBJECT_SELECTED", null), null, new LocalizableMessage[]
                    { new WTMessage("com.ptc.netmarkets.util.utilResource", "NO_OBJECT_SELECTED", null) });
            formresult.addFeedbackMessage(feedbackmessage);
            formresult.setStatus(FormProcessingStatus.FAILURE);
            return formresult;
        }
        return formresult;
    }
}
